package com.sailor.event;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class OrderEventListener {

    @EventListener(OrderEvent.class)
    public Object onApplicationEvent(OrderEvent event) {
        if(event.getName().equals("已登录")){
            System.out.println("已登录.......");
            return new Exception("自定义异常");
        }
        return new Exception("自定义异常");
    }
}
